﻿using UnityEngine;
using GameFramework;

namespace MYSTARFORCE
{
    public class HideByBoundary : MonoBehaviour
    {
        private void OnTriggerExit(Collider other)
        {
            GameObject go = other.gameObject;
            Entity entity = go.GetComponent<Entity>();
            if (entity == null)
            {
                Log.Warning("Unknown GameObject '{0}', you must use entity only.", go.name);
                Destroy(go);
                return;
            }
            // 当物体离开VisibleBoundary的时候，就执行HideEntity方法
            GameEntry.Entity.HideEntity(entity);
        }
    }
}
